package com.erp.erp_servers.business.imp;

import com.erp.erp_dao.business.IOfferCostDao;
import com.erp.erp_entitys.business.entity.OfferCostEntity;
import com.erp.erp_servers.business.IOfferCostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName : OfferCostServiceImp
 * @Description : 报价费用接口实现类
 * @Author : lst
 * @Date: 2021-01-14 10:23
 */
@Service
public class OfferCostServiceImp implements IOfferCostService {

    /**
     * 注入费用mapper
     */
    private final IOfferCostDao offerCostDao;

    @Autowired
    public OfferCostServiceImp(IOfferCostDao offerCostDao) {
        this.offerCostDao = offerCostDao;
    }

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public OfferCostEntity queryById(Integer id) {
        return offerCostDao.queryById(id);
    }

    /**
     * 通过实体作为筛选条件查询
     *
     * @param offerCost 实例对象
     * @return 对象列表
     */
    @Override
    public List<OfferCostEntity> queryAll(OfferCostEntity offerCost) {
        return offerCostDao.queryAll(offerCost);
    }

    /**
     * 新增数据
     *
     * @param offerCost 实例对象
     * @return 影响行数
     */
    @Override
    public int insert(OfferCostEntity offerCost) {
        return offerCostDao.insert(offerCost);
    }

    /**
     * 详情批量新增
     * @param list 新增对象集合
     * @return 影响行数
     */
    @Override
    public int addList(List<OfferCostEntity> list) {
        return offerCostDao.addList(list);
    }

    /**
     * 修改数据
     *
     * @param offerCost 实例对象
     * @return 影响行数
     */
    @Override
    public int update(OfferCostEntity offerCost) {
        return offerCostDao.update(offerCost);
    }
}
